package com.example.gitproject.controller;

import cn.dev33.satoken.util.SaResult;
import com.example.gitproject.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController   //接受客户端请求  HttpServletRequest
@RequestMapping("book")
public class BookController {

    @Autowired
    private BookService bookService;
    //查询全部书籍
    @GetMapping("/findBook")
    public SaResult findBook() {
       List list = bookService.findAll();
       return SaResult.data(list);
    }
}
